Skip to content

Isolate program memory tests as async: false - #182

Merged
ausimian merged 1 commit into
feat/expr-compilerfrom
feat/expr-compiler-memory-test-isolation
Jun 6, 2026
Merged

Isolate program memory tests as async: false#182
ausimian merged 1 commit into
feat/expr-compilerfrom
feat/expr-compiler-memory-test-isolation

Conversation

@ausimian

@ausimian ausimian commented Jun 6, 2026

Copy link
Copy Markdown
Owner

The two Emily.ProgramTest "memory" leak-detection tests assert tiny
deltas (64 KB / 4 MB) on the process-global MLX active-memory metric
(Native.get_active_memory/0). Under async: true they can run
concurrently with model-loading tests (the :conformance / *_full
lanes), which inflate the global reading mid-measurement and blow the
deltas up — a false positive that only surfaces in a full
mix test --include ... run (the default suite excludes those heavy
lanes, so it never hit this; PR CI runs the default suite, so it was
green too).

Fix: split the two tests into a new Emily.ProgramMemoryTest
(async: false) so they get an exclusive run with no concurrent
allocations. The rest of Emily.ProgramTest stays async: true.
add_chain_ir is duplicated into the new module (small, self-contained);
the shared helpers it uses (worker/f32/to_f32_list) already live in
Emily.TensorHelpers.

Verification

A full all-tags local run (--include conformance native native_compiled vit_full whisper_full distilbert_full training_full fast_kernels_full)
is now 745 tests, 0 failures (was 2). No production code touched —
test isolation only.

The two Emily.ProgramTest "memory" leak-detection tests assert tiny
deltas (64 KB / 4 MB) on the process-global MLX active-memory metric
(Native.get_active_memory/0), measured across two points. Under
async: true they can run concurrently with model-loading tests (the
:conformance / *_full lanes), which inflate the global reading
mid-measurement and blow the deltas up — a false positive surfaced only
by a full `mix test --include ...` run (the default suite excludes those
heavy lanes, so it never hit this).

Split them into Emily.ProgramMemoryTest (async: false) so they get an
exclusive run with no concurrent allocations; the rest of
Emily.ProgramTest stays async: true. add_chain_ir is duplicated into the
new module (small, self-contained); the shared helpers it uses
(worker/f32/to_f32_list) already live in Emily.TensorHelpers.

A full all-tags run is now 745 tests, 0 failures (was 2).
@ausimian
ausimian merged commit 26faf73 into feat/expr-compiler Jun 6, 2026
3 checks passed
@ausimian
ausimian deleted the feat/expr-compiler-memory-test-isolation branch June 6, 2026 06:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant